//失联人员登记
function toSldjTab(localCode) {
    if(localCode == "140000") {
        mini.open({
            url: "/azbj/bjdxInfo/slrygl/toSldj/view",
            title: "人户分离登记",
            width: 650,
            height: 580,
            allowDrag: true,
            allowResize: false,
            showCloseButton: true,
            onload: function () {
            },
            ondestroy: function (action) {
                grid.reload();
            }
        });
    } else {
        mini.open({
            url: "/azbj/bjdxInfo/slrygl/toSldj/view",
            title: "失联登记",
            width: 650,
            height: 580,
            allowDrag: true,
            allowResize: false,
            showCloseButton: true,
            onload: function () {
            },
            ondestroy: function (action) {
                grid.reload();
            }
        });
    }
}

function toSlzhTab() {
    var row = grid.getSelected();
    mini.open({
        url: "/azbj/bjdxInfo/slrygl/toSlzh/view?priNum=" + row.priNum + "&slId=" + row.slId,
        title: "找回",
        width: "50%",
        height: "60%",
        allowDrag: true,
        allowResize: false,
        showCloseButton: true,
        onload: function () {
        },
        ondestroy: function (action) {
            grid.reload();
        }
    });
}

function toSljlTab(localCode) {
    var row = grid.getSelected();
    if(localCode == "140000") {
        mini.open({
            url: "/azbj/bjdxInfo/slrygl/toSljlViewTab?priNum=" + row.priNum + "&slId=" + row.slId,
            title: "人户分离记录",
            width: "50%",
            height: "60%",
            allowDrag: true,
            allowResize: false,
            showCloseButton: true,
            onload: function () {
            },
            ondestroy: function (action) {
                grid.reload();
            }
        });
    } else {
        mini.open({
            url: "/azbj/bjdxInfo/slrygl/toSljlViewTab?priNum=" + row.priNum + "&slId=" + row.slId,
            title: "失联记录",
            width: "50%",
            height: "60%",
            allowDrag: true,
            allowResize: false,
            showCloseButton: true,
            onload: function () {
            },
            ondestroy: function (action) {
                grid.reload();
            }
        });
    }
}

function onSlActionRenderer(e) {
    var record1 = e.value;
    var arr = record1.split("@");
    var level = arr[0];
    var fs = arr[1];
    var localCode = arr[2];
    var s = "";
    if (level == '3') {
        if (fs == "1") {
            s += '&nbsp;<a class="mini-button mini-button-warning"  onclick="toSlzhTab()"  >&nbsp;&nbsp;找回&nbsp;&nbsp;</a>&nbsp';
            if(localCode == "140000") {
                s += '&nbsp;<a class="mini-button mini-button-success"  onclick="toSljlTab(140000)"  >&nbsp;&nbsp;人户分离记录&nbsp;&nbsp;</a>&nbsp';
            } else {
                s += '&nbsp;<a class="mini-button mini-button-success"  onclick="toSljlTab()"  >&nbsp;&nbsp;失联记录&nbsp;&nbsp;</a>&nbsp';
            }
        } else {
            if(localCode == "140000") {
                s += '&nbsp;<a class="mini-button mini-button-success"  onclick="toSljlTab(140000)"  >&nbsp;&nbsp;人户分离记录&nbsp;&nbsp;</a>&nbsp';
            } else {
                s += '&nbsp;<a class="mini-button mini-button-success"  onclick="toSljlTab()"  >&nbsp;&nbsp;失联记录&nbsp;&nbsp;</a>&nbsp';
            }
            s += '&nbsp;<a class="mini-button mini-button-info"  onclick="toViewHjqc()"  >&nbsp;&nbsp;查看&nbsp;&nbsp;</a>&nbsp';
        }
    } else if (level == '8' || level == '6' || level == '7') {
        if(localCode == "140000") {
            s += '&nbsp;<a class="mini-button mini-button-success"  onclick="toSljlTab(140000)"  >&nbsp;&nbsp;人户分离记录&nbsp;&nbsp;</a>&nbsp';
        } else {
            s += '&nbsp;<a class="mini-button mini-button-success"  onclick="toSljlTab()"  >&nbsp;&nbsp;失联记录&nbsp;&nbsp;</a>&nbsp';
        }
        s += '&nbsp;<a class="mini-button mini-button-info"  onclick="toViewHjqc()"  >&nbsp;&nbsp;查看&nbsp;&nbsp;</a>&nbsp';
    }
    return s;
}

//全部人员管理--查看
function toViewHjqc() {
    var row = grid.getSelected();
    mini.open({
        url: "/azbj/bjdxInfo/hjqc/toViewTabs/view?priNum=" + row.priNum,
        title: "查看",
        width: "60%",
        height: "80%",
        allowDrag: true,
        allowResize: false,
        showCloseButton: true,
        onload: function () {
        },
        ondestroy: function (action) {
            grid.reload();
        }
    });
}

//基本查询
function shaiSelect() {
    var val = mini.get("shaixuan").getValue();
    var url = "/azbj/azbjgl/bjdxInfo/slrygl/list?1=1";
    if (val == "0") {////查询所有信息
        allInfo(url);
    } else if (val == "1") {  //户籍完整
        selectHjwz(url);
    } else if (val == "2") {////查不清户籍
        selectNoHj(url);
    } else if (val == "3") {//有未成年子女成员
        juvenileInfo(url);
    } else if (val == "4") {//无照片指纹
        nomutiInfo(url);
    } else if (val == "5") {////今日释放
        jinRiShiFang(url);
    } else if (val == "6") {//未录入狱中表现
        weiLuRuYuZhongBiaoXian(url);
    } else if (val == "7") { // 未录入危险性评估
        noPingGu(url);
    } else if (val == "8") { // 重点帮教对象
        bjdxlb(url, 8);
    } else if (val == "9") { // 一般帮教对象
        bjdxlb(url, 9);
    } else if (val == "10") { // 失联人员
        slry(url);
    }
}

//查询所有信息
function allInfo(url1) {
    grid.setUrl(url1);
    grid.reload();
}

//无照片指纹
function nomutiInfo(url1) {
    var url = url1 + "&type=4";
    grid.setUrl(url);
    grid.reload();
}

//今日释放
function jinRiShiFang(url1) {
    var url = url1 + "&type=5";
    grid.setUrl(url);
    grid.reload();
}

//未录入狱中表现
function weiLuRuYuZhongBiaoXian(url1) {
    var url = url1 + "&type=6";
    grid.setUrl(url);
    grid.reload();
}

// 未录入危险性评估
function noPingGu(url1) {
    var url = url1 + "&type=7";
    grid.setUrl(url);
    grid.reload();
}

// 帮教对象类别
function bjdxlb(url1, type) {
    var url = url1 + "&type=" + type;
    grid.setUrl(url);
    grid.reload();
}

// 失联人员
function slry(url1) {
    var url = url1 + "&type=" + 10;
    grid.setUrl(url);
    grid.reload();
}